#ifndef threadevent_h__
#define threadevent_h__
#include <windows.h>

namespace gecko
{

// Thread synchronisation event.
class ThreadEvent
{
public:
	// Constructor.
	ThreadEvent(bool manualReset = false);

	// Destructor.
	virtual ~ThreadEvent();

	// Put the calling thread into a waiting state.
	void Wait();

	// Wait on the event without blocking the calling thread.
	// Returns true if the event was signalled.
	bool TryWait();

	// Trigger the event.
	void Signal();

	// Reset the event.
	void Reset();

private:
	HANDLE m_EventHandle;
};

}

#endif // threadevent_h__
